﻿using System.ComponentModel;
using System.Linq;
using System.Windows;
using Fayshine.VA.Helpers;
using Fayshine.VA.RIAService.Web;
using Fayshine.VA.Controls;
using System.Collections.Generic;

namespace Fayshine.VA.ViewModels
{
    public class DeviceViewModel : INotifyPropertyChanged
    {

        private vaserver m_Device;

        public vaserver SelectedDevice
        {
            get
            {
                return m_Device;
            }
            set
            {
                if (m_Device != value)
                {
                    m_Device = value;
                    NofityPropertyChanged("SelectedDevice");
                }
            }
        }

        public PagedObservableCollectionView<camera> Cameras
        {
            get;
            set;
        }

        public DeviceViewModel(vaserver vaserver)
        {
            this.SelectedDevice = vaserver;
            if (vaserver.cameras.Count > 0)
            { 
               
            }
        }


        #region INotifyPropertyChanged Interface

        public event PropertyChangedEventHandler PropertyChanged;
        public void NofityPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }


}
